The term “portability” as used in computer science refers to the ability to use the same software in different computing environments. The term “portable code” can be used to refer to code that is not platform-specific. That is, the very same software can run on any platform or at least on multiple platforms. The term “portable code” can also be used to refer to code that can be more cost-effectively changed to run on a different platform than writing the software from scratch. To distinguish these different usages of the same term, the term “universally portable code” will be used to refer to platform-agnostic code that can run on any platform. The term “portable code” will be used to refer to code that can be changed to run on different platforms cost-effectively.
One way to create different versions of code to run on different platforms is by conditional compilation. Conditional compilation enables the compiler to produce multiple different executables associated with multiple different platforms by compiling the code multiple times. The compiler is run with one set of parameters or directives to generate an executable for a first platform and is run with another set of parameters or directives to generate an executable for a second platform and so on.